<template>
	<view class="wrap">
		<u-swiper :height="270" :list="imgList" :title="false"></u-swiper>
		<view class="workbench-title">日常办公</view>
		<view class="toolbar">
			<u-grid class="grid" :col="3" :border="false">
				<u-grid-item @click="navTo('/pages/sys/user/info')">
					<view class="home-icon icon-color04">
						<i class="iconfont icon-moban"></i>
					</view>
					<view class="grid-text">个人信息</view>
				</u-grid-item>
				<u-grid-item @click="navTo('/pages/sys/login/index')">
					<u-icon class="u-icon" size="100" color="#36c956" name="weixin-circle-fill"></u-icon>
					<view class="grid-text">登录</view>
				</u-grid-item>
				<u-grid-item @click="navTo('/pages/sys/user/comment')">
					<view class="home-icon icon-color04">
						<i class="iconfont icon-baoming"></i>
					</view>
					<view class="grid-text">意见建议</view>
				</u-grid-item>
			</u-grid>
		</view>
		<view class="workbench-title">献血科普</view>
		<scroll-view class="scroll-list" scroll-y="true">
			<view class="uni-list">
				<view class="uni-list-cell" @click="navTo('/pages/sys/msg/list-notice')">
					<uni-view class="uni-media-list">
						<u-icon style="margin-left:25px" name="heart-fill" size="60" color="red" ></u-icon>
						<uni-view class="uni-media-list-body">
							<uni-view class="uni-media-list-text-top"><span>献血科普</span><span
									style="font-size: 26rpx;color: #999999;">{{time}}</span></uni-view>
							<uni-view class="uni-media-list-text-bottom">
								<uni-text><span>适量献血可提高免疫力</span></uni-text>
							</uni-view>
						</uni-view>
					</uni-view>
				</view>
			</view>
		</scroll-view>
		<u-divider>藏ICP备2022000194号</u-divider>
	</view>

</template>
<script>
	import HeadNavBar from '@/components/headnavbar/index';
	/**
	 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
	 */
	export default {
		components: {
			HeadNavBar
		},
		data() {
			return {
				show: false,
				head: '/static/aidex/images/head.png',
				imgList: [{
						image: '/static/aidex/banner/banner01.png'
					},
					{
						image: '/static/aidex/banner/banner02.png'
					},
					{
						image: '/static/aidex/banner/banner03.png'
					}
				],
				todoCount: 3,
				time: new Date().getFullYear()+"-"+new Date().getMonth()+"-"+new Date().getDay(),
			};
		},
		onLoad() {
            this.$u.api.filelist({
            }).then(res => {
            	  //  console.log(res);
            	if (res.code == '200'){
					
					console.log(this.$data);
					for (var i = 0;  i<res.rows.length; i++) {
					this.imgList.push({
						image:res.rows[i].image
					});
					
					}
    
            	
            	}else if (res.code == '401'){
            		uni.reLaunch({
            			url: '/pages/sys/login/index'
            		});
            	}else{
            		this.$u.toast("请登录后重试");
            	}
            });
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url: url
				});
			},
			imgListClick(index) {
				console.log(`点击了第${index + 1}页图片`)
			},
			itemClick(index) {
				console.log(index);
			}
		}
	};
</script>
<style lang="scss">
	@import 'index.scss';
	@import '../../../common/uni.css';

	.banner-box {
		padding: 0 2%;
		width: 96%;
		height: 170rpx;
		margin: 30rpx 0 30rpx;
	}

	.u-swiper-wrap {
		padding: 0 10px;
	}

	.banner-pic {
		width: 47%;
		float: left;
		display: inline-block;
		margin: 0 1.5%;
	}

	.banner-pic image {
		width: 100%;
		height: 170rpx;
		border-radius: 12rpx;
		box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
	}

	.u-mode-light-info {
		background-color: #ffffff;
		color: #666666;
		border: 1px solid #e9ecf6;
		font-size: 12px;
		padding: 2px 8px;
		position: relative;
		top: -3px;
	}

	.workbench-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		padding: 15px 30rpx;
	}

	.home-icon i.icon-tongzhi {
		font-size: 22px;
	}

	.uni-title {
		font-size: 30rpx;
		color: #333333;
		padding: 10px;
		background: #fff;
		border-top: 1px solid #ededed;
		margin-top: 20rpx;
	}

	.uni-media-list {
		padding: 15px 15px;

	}

	.uni-media-list-body {
		height: 42px;
		padding-left: 20rpx;
	}

	.uni-media-list-text-top {
		height: 40rpx;
		overflow: hidden;
		width: 100%;
		line-height: 40rpx;
		font-size: 32rpx;
		display: flex;
		justify-content: space-between;
	}

	.uni-media-list-text-bottom {
		width: 100%;
		line-height: 24rpx;
		font-size: 26rpx;
		color: #666666;

		span {
			margin-right: 10rpx;
		}
	}
</style>
